package main

import (
	"fmt"
	"strings"
)

func main() {
	isBegin := strings.HasPrefix("123lin", "123")
	println(isBegin)
	isTail := strings.HasSuffix("123lin", "lin")
	println(isTail)
	isCtn := strings.Contains("123lin", "lin")
	println(isCtn)
	idx := strings.Index("123lin", "lin")
	println(idx)
	idx = strings.LastIndex("123123123", "123")
	println(idx)
	s1 := strings.TrimSpace("  \n\r\t123lin ")
	println(s1)
	s1 = strings.Trim("   123lin ", " \t") // 后面的cutset是字符集合, 不是正则
	println(s1)
	s2 := strings.Replace("linlin7", "lin", "0", -1) // 替换全部
	println(s2)
	s2 = strings.Replace("linlin7", "lin", "0", 1) // 替换第1个
	println(s2)
	s2 = strings.Replace("linlin7", "lin", "0", 0) // 不替换
	println(s2)
	s3 := strings.ToUpper("123lin")
	s3 = strings.ToLower("123LIN")
	println(s3)
	s4 := strings.ToTitle("shuoGG the end")
	println(s4)
	ss1 := strings.Split("a,b,c", ",")
	fmt.Printf("%v\n", ss1)
}
